
#ifndef _FUN_H_
#define _FUN_H_

#include <sys/types.h>
#include <sys/socket.h>

#include <arpa/inet.h>
#include <net/ethertypes.h>
#include <net/if.h>
#include <net/if_llc.h>

#include <netinet/if_ether.h>
#include <netinet/in_systm.h>
#include <netinet/in.h>
#include <netinet/ip.h>
#include <netinet/ip6.h>
#include <netinet/tcp.h>
#include <netinet/udp.h>


#include <netinet6/in6.h>

#include <errno.h>
#include <netdb.h>
#include <pcap.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <time.h>
#include <unistd.h>

#include "fr_struct.h"
#include "m_list.h"

#define print_h(num)\
  if(num<16)\
   printf("0%x ",num);\
  else\
   printf("%x ",num);

/*console functions*/
int ask_user_c (struct fr_list *fr_start);
int ask_user_m (struct m_list *m_start);
int c_help (void);

/*pcap_loop callback rutines */
void net_callb_r_a   (u_char *args, const struct pcap_pkthdr *header, const u_char *pkt_data);
void net_callb_r_c   (u_char *args, const struct pcap_pkthdr *header, const u_char *pkt_data);
void net_callb_s_con (u_char *args, const struct pcap_pkthdr *header, const u_char *pkt_data);
void net_callb_r_d   (u_char *args, const struct pcap_pkthdr *header, const u_char *pkt_data);
void net_callb_s_m   (u_char *args, const struct pcap_pkthdr *header, const u_char *pkt_data);

/*network helper functions */
int ch_tcp_ip (const u_char *pkt_data,int offset);
int ep_num_n  (u_int16_t ether_type);
int get_tcp_syn (const u_char *pkt_data,int offset);
int res_ip_p (u_int8_t  ip_p);
int get_offset (const u_char *pkt_data);





#endif  /*end fun.h */
